'''score = int(input("请输入分数"))
grade =""
if(score<60):
    grade="不及格"
if(60<=score<80):
    grade="及格"
if(80<=score<90):
    grade="良好"
if(90<=score<=100):
    grade="优秀"

print("分数是{0},等级是{1}".format(score,grade))
'''

'''
# 多分支选择结构
x=int(input("请输入x坐标"))
y=int(input("请输入y坐标"))

if(x==0 and y==0):print("原点")
elif(x==0):print("y轴")
elif(y==0):print("x轴")
elif(x>0,y>0):print("第一象限")
elif(x<0,y>0):print("第二象限")
elif(x<0,y<0):print("第三象限")
elif(x>0,y<0):print("第四象限")
'''


# score = int(input("请输入成绩"))
# grade=""
#
# if score>100 or score<0:
#     score= int(input("输入错误，请重新输入"))
# else:
#     if score>=90:
#         grade="A"
#     elif score>=80:
#         grade="B"
#     elif score>=70:
#         grade = "C"
#     elif score>=60:
#         grade = "D"
#     else:
#         grade="E"
#     print("分数为{0},等级为{1}".format(score,grade))


# score = int(input("请输入一个数字"))
# A="ABCDE"
# num=0
# if score>100 or score<0:
#     score= int(input("输入错误，请重新输入"))
# else:
#     num=score//10
#     if num<6:
#         num=5
#     print(A[9-num])
#     妙啊

#循环语句while
# num=0
# while num<=20:
#     print(num)
#     num+=1
#

# num=0
# sum_all=0
# while(num<=100):
#     num_addall=sum_all+num
#     num+=1
#     print(sum_all)

#for循环语句
# for x in (10,20,30,40):
#     print(x*3)


#字典
# a={"name":"zhangmao","age":"26","job":"teacher"}
# for x in a:
#     print(x)
# for x in a.keys():
#     print(x)
# for x in a.values():
#     print(x)
# for x in a.items():
#     print(x)
#



# sum_even=0
# sum_odd=0
# sum=0
# for x in range(101):
#    sum=sum+x
#    if x%2==1:
#        sum_odd=sum_odd+x
#
#    else:
#        sum_even+=x
#
# print("1-100累加总和是：   ",sum)
# print("1-100奇数累加总和是：",sum_odd)
# print("1-100偶数累加总和是：",sum_even)
# print("1-100累加总和是：{0},1-100奇数累加总和是：{1},1-100偶数累加总和是：{2}".format(sum,sum_odd,sum_even))


#嵌套循环

# for x in range(5):
#     for y in range(5):
#         print(x,end="\t")
#
#     print()
#

# 九九乘法表
# for x in range(1,10):
#     for y in range(1,10):
#         if(y<=x):
#             print("{0}*{1}={2}".format(y,x,(y*x)),end="\t")
#     print()
#
#九九乘法表
# for x in range(1,10):
#     for y in range(1,x+1):
#         print("{0}*{1}={2}".format(y,x,(y*x)),end="\t")
#     print()



# r1=dict(name="高小一",age=18,salary=30000,city="北京")
# r2=dict(name="高小二",age=19,salary=20000,city="上海")
# r3=dict(name="高小三",age=20,salary=10000,city="深圳")
# tb=[r1,r2,r3]
# for x in tb:
#     if x.get("salary")>15000:
#         print(x)

#break 测试
#
# while True:
#     a=input("请输入暗号：")
#     if a=="Q":
#         print("输入正确，请进入")
#         break
#     else:
#         print("输入错误，请重新输入:")


#------------------------------------------
#计算平均工资
# empNum=0
# salarySum=0
# salarys=[]
# while True:
#     s=input("请输入员工薪资（按Q或q结束）")
#
#     if s.upper()=="Q":  #upper小写字母转化成大写字母
#         print("录入完成，退出")
#         break
#     if float(s)<0:
#         continue
#     empNum=empNum+1
#     salarys.append(float(s))   #append 列表末尾加一个对象
#     salarySum += float(s)
# print("员工数{0}".format(empNum))
# print("录入薪资：",salarys)
# print("平均薪资{0}".format(salarySum/empNum))
#-----------------------------------------------


#else语句
#——————————————————————————————————————————————————
# salarySum=0
# salarys=[]
#
# for i in range(4):
#     s = input("请输入工资，或按q/Q结束")
#     if s.upper()=="Q":
#         print("录入完成，退出")
#         break
#     if float(s)<0:
#         continue
#     salarys.append(float(s))
#     salarySum+=float(s)
# else:
#     print("已经录入完成4名员工薪资")
# print("录入薪资:",salarys)
# print("平均薪资{0}".format(salarySum/4))
#____________________________________________________


#循环代码优化(减少内层循环计算）______________________________________________________
# import time
# start=time.time()
# for i in range(1000):
#     result=[]
#     for m in range(10000):
#         result.append(i*1000+m*100)
# end = time.time()
# print("耗时：{0}".format(end-start))
#
# start02=time.time()
# for i in range(1000):
#     result=[]
#     c=i*1000
#     for m in range(10000):
#         result.append(c+m*100)
# end2=time.time()
# print("耗时：{0}".format(end2-start02))
#————————————————————————————————————————————————————————————————————————————



#使用zip（）并行迭代
# names=("电风扇","沙发垫","手动挡","大丰收")
# ages=("30","18","20","19")
# jobs=("工人","大哥","公务员","程序猿")
#
# for name,age,job in zip(names,ages,jobs):
#     print("姓名：{0}   年龄：{1}   职业：{2}".format(name,age,job))